package com.wicket.okrpbff.web.contorller;

import com.wicket.okrpbff.biz.service.BaseService;
import com.wicket.okrpbff.biz.service.dto.req.*;
import com.wicket.okrpbff.biz.service.dto.res.*;
import com.wicket.okrpbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.integration.FwBaseBaseClient;
import com.wicket.okrframework.integration.dto.AddSceneRespDto;
import com.wicket.okrframework.integration.dto.AddSceneReqDto;
import com.wicket.okrpbff.common.exception.Assert;
import com.wicket.okrframework.integration.dto.UpdateSceneRespDto;
import com.wicket.okrframework.integration.dto.UpdateSceneReqDto;
import com.wicket.okrframework.integration.dto.QuerySceneDetailRespDto;
import com.wicket.okrframework.integration.dto.QuerySceneDetailReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComReqDto;
import com.wicket.okrframework.integration.dto.QuerySpaceListRespDto;
import com.wicket.okrframework.integration.dto.QuerySpaceListReqDto;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComReqDto;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrapp.integration.FwAppOffStateClient;
import com.wicket.okrapp.integration.dto.QueryCheckItemListRespDto;
import com.wicket.okrapp.integration.dto.QueryCheckItemListReqDto;
import com.wicket.okrframework.integration.dto.AddSpaceRespDto;
import com.wicket.okrframework.integration.dto.AddSpaceReqDto;
import com.wicket.okrpbff.common.exception.BizException;
import com.wicket.okrframework.integration.dto.QuerySpaceDetailComRespDto;
import com.wicket.okrframework.integration.dto.QuerySpaceDetailComReqDto;
import com.wicket.okrframework.integration.dto.UpdateSpaceRespDto;
import com.wicket.okrframework.integration.dto.UpdateSpaceReqDto;
import com.wicket.okrframework.integration.dto.QueryAppListRespDto;
import com.wicket.okrframework.integration.dto.QueryAppListReqDto;
import com.wicket.okrframework.integration.dto.QueryAppDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryAppDetailReqDto;
import com.wicket.okrframework.integration.FwBaseCommonClient;
import com.wicket.okrframework.integration.dto.AddAppRespDto;
import com.wicket.okrframework.integration.dto.AddAppReqDto;
import com.wicket.okrframework.integration.dto.PutSpaceInfoToRedisRespDto;
import com.wicket.okrframework.integration.dto.PutSpaceInfoToRedisReqDto;
import com.wicket.okrframework.integration.dto.UpdateAppRespDto;
import com.wicket.okrframework.integration.dto.UpdateAppReqDto;
import com.wicket.okrframework.integration.dto.QuerySceneListRespDto;
import com.wicket.okrframework.integration.dto.QuerySceneListReqDto;
import com.wicket.okrpbff.common.util.CommonFunctionHelper;
import com.wicket.okrframework.integration.dto.QueryAppListBorderRespDto;
import com.wicket.okrframework.integration.dto.QueryAppListBorderReqDto;
import com.wicket.okrpbff.biz.service.dto.common.BffUnionAppDto;
import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrframework.integration.dto.QuerySceneListBorderRespDto;
import com.wicket.okrframework.integration.dto.QuerySceneListBorderReqDto;
import com.wicket.okrpbff.biz.service.dto.common.BffSenceDto;
import java.util.ArrayList;
import java.util.List;
import com.wicket.okrframework.integration.dto.QuerySpaceListComRespDto;
import com.wicket.okrframework.integration.dto.QuerySpaceListComReqDto;
import com.wicket.okrpbff.biz.service.dto.common.BffScreenSpaceDto;
import com.wicket.okrapp.integration.dto.TransitionCheckItemComRespDto;
import com.wicket.okrapp.integration.dto.TransitionCheckItemComReqDto;
import com.wicket.okrcomponent.integration.FwCompMessageClient;
import com.wicket.okrcomponent.integration.dto.ImplementIniOrgWorkTaskMsgLocationByLoginComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementIniOrgWorkTaskMsgLocationByLoginComReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "Base", tags = {"Base"})
@RestController
// @RequestMapping("/poms/base/")
public class BaseController {
    @Autowired
    BaseService baseService;

    /**
   * B1-2新增场景（平台）
   * gen by moon at 8/10/2022, 3:39:23 AM
   */
    @PostMapping("/oms/platform/base/addScene")
    @ApiOperation(value = "B1-2新增场景（平台）", response = OkrResult.class)
    public OkrResult<BffAddSceneRespDto> addScene(@RequestBody(required=false) @Validated BffAddSceneReqDto reqDTO){
        return OkrResult.success(baseService.addScene(reqDTO));
    }

    /**
   * B1-2查询空间列表（平台）
   * gen by moon at 8/10/2022, 3:39:51 AM
   */
    @PostMapping("/oms/platform/base/querySpaceList")
    @ApiOperation(value = "B1-2查询空间列表（平台）", response = OkrResult.class)
    public OkrResult<BffQuerySpaceListRespDto> querySpaceList(@RequestBody(required=false) @Validated BffQuerySpaceListReqDto reqDTO){
        return OkrResult.success(baseService.querySpaceList(reqDTO));
    }

    /**
   * B1-2存档联盟应用(平台）
   * gen by moon at 8/10/2022, 3:43:44 AM
   */
    @PostMapping("/oms/platform/base/archiveApp")
    @ApiOperation(value = "B1-2存档联盟应用(平台）", response = OkrResult.class)
    public OkrResult<BffArchiveAppRespDto> archiveApp(@RequestBody(required=false) @Validated BffArchiveAppReqDto reqDTO){
        return OkrResult.success(baseService.archiveApp(reqDTO));
    }

    /**
   * B1-2存档场景（平台）
   * gen by moon at 8/10/2022, 3:43:42 AM
   */
    @PostMapping("/oms/platform/base/archiveScene")
    @ApiOperation(value = "B1-2存档场景（平台）", response = OkrResult.class)
    public OkrResult<BffArchiveSceneRespDto> archiveScene(@RequestBody(required=false) @Validated BffArchiveSceneReqDto reqDTO){
        return OkrResult.success(baseService.archiveScene(reqDTO));
    }

    /**
     * 11111B1-2查应用短信配置详情
     */
    @PostMapping("/oms/platform/base/queryAppMessageSetDetail")
    @ApiOperation(value = "11111B1-2查应用短信配置详情", response = OkrResult.class)
    public OkrResult<BffQueryAppMessageSetDetailRespDto> queryAppMessageSetDetail(@RequestBody(required = false) @Validated BffQueryAppMessageSetDetailReqDto reqDTO) {
        return OkrResult.success(baseService.queryAppMessageSetDetail(reqDTO));
    }

    /**
     * 111111B1-2修改应用短信配置
     */
    @PostMapping("/oms/platform/base/updateAppMessageSet")
    @ApiOperation(value = "111111B1-2修改应用短信配置", response = OkrResult.class)
    public OkrResult<BffUpdateAppMessageSetRespDto> updateAppMessageSet(@RequestBody(required = false) @Validated BffUpdateAppMessageSetReqDto reqDTO) {
        return OkrResult.success(baseService.updateAppMessageSet(reqDTO));
    }

    /**
   * B1-2新增平台应用（平台）
   * gen by moon at 12/2/2022, 5:09:39 PM
   */
    @PostMapping("/oms/platform/base/addPlatformApp")
    @ApiOperation(value = "B1-2新增平台应用（平台）", response = OkrResult.class)
    public OkrResult<BffAddPlatformAppRespDto> addPlatformApp(@RequestBody(required=false) @Validated BffAddPlatformAppReqDto reqDTO){
        return OkrResult.success(baseService.addPlatformApp(reqDTO));
    }

    /**
   * B1-1完善平台应用（平台）
   * gen by moon at 8/10/2022, 3:43:30 AM
   */
    @PostMapping("/oms/platform/base/perfectPlatformApp")
    @ApiOperation(value = "B1-1完善平台应用（平台）", response = OkrResult.class)
    public OkrResult<BffPerfectPlatformAppRespDto> perfectPlatformApp(@RequestBody(required=false) @Validated BffPerfectPlatformAppReqDto reqDTO){
        return OkrResult.success(baseService.perfectPlatformApp(reqDTO));
    }

    /**
   * B1-2取消设无效空间（平台）
   * gen by moon at 8/10/2022, 3:43:29 AM
   */
    @PostMapping("/oms/platform/base/cancelIsinvalidSetSpaceId")
    @ApiOperation(value = "B1-2取消设无效空间（平台）", response = OkrResult.class)
    public OkrResult<BffCancelIsinvalidSetSpaceIdRespDto> cancelIsinvalidSetSpaceId(@RequestBody(required=false) @Validated BffCancelIsinvalidSetSpaceIdReqDto reqDTO){
        return OkrResult.success(baseService.cancelIsinvalidSetSpaceId(reqDTO));
    }

    /**
   * B1-2查场景列表（公共）
   * gen by moon at 8/10/2022, 3:43:12 AM
   */
    @PostMapping("/oms/platform/base/querySceneListCom")
    @ApiOperation(value = "B1-2查场景列表（公共）", response = OkrResult.class)
    public OkrResult<BffQuerySceneListComRespDto> querySceneListCom(@RequestBody(required=false) @Validated BffQuerySceneListComReqDto reqDTO){
        return OkrResult.success(baseService.querySceneListCom(reqDTO));
    }

    /**
   * B1-2查联盟应用列表（边界）
   * gen by moon at 8/10/2022, 3:43:08 AM
   */
    @PostMapping("/oms/platform/base/queryAppListBorder")
    @ApiOperation(value = "B1-2查联盟应用列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryAppListBorderRespDto> queryAppListBorder(@RequestBody(required=false) @Validated BffQueryAppListBorderReqDto reqDTO){
        return OkrResult.success(baseService.queryAppListBorder(reqDTO));
    }

    /**
   * B1-2设为是否无效空间（平台）
   * gen by moon at 8/10/2022, 3:41:07 AM
   */
    @PostMapping("/oms/platform/base/updateIsinvalidSetSpaceId")
    @ApiOperation(value = "B1-2设为是否无效空间（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateIsinvalidSetSpaceIdRespDto> updateIsinvalidSetSpaceId(@RequestBody(required=false) @Validated BffUpdateIsinvalidSetSpaceIdReqDto reqDTO){
        return OkrResult.success(baseService.updateIsinvalidSetSpaceId(reqDTO));
    }

    /**
   * B1-2查询场景列表（平台）
   * gen by moon at 8/10/2022, 3:41:05 AM
   */
    @PostMapping("/oms/platform/base/querySceneList")
    @ApiOperation(value = "B1-2查询场景列表（平台）", response = OkrResult.class)
    public OkrResult<BffQuerySceneListRespDto> querySceneList(@RequestBody(required=false) @Validated BffQuerySceneListReqDto reqDTO){
        return OkrResult.success(baseService.querySceneList(reqDTO));
    }

    /**
   * B1-2查询空间应用详情（平台）
   * gen by moon at 11/29/2022, 8:06:51 PM
   */
    @PostMapping("/oms/platform/base/querySpaceAppDetail")
    @ApiOperation(value = "B1-2查询空间应用详情（平台）", response = OkrResult.class)
    public OkrResult<BffQuerySpaceAppDetailRespDto> querySpaceAppDetail(@RequestBody(required=false) @Validated BffQuerySpaceAppDetailReqDto reqDTO){
        return OkrResult.success(baseService.querySpaceAppDetail(reqDTO));
    }

    /**
   * B1-2修改联盟应用（平台）
   * gen by moon at 8/10/2022, 3:40:33 AM
   */
    @PostMapping("/oms/platform/base/updateApp")
    @ApiOperation(value = "B1-2修改联盟应用（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateAppRespDto> updateApp(@RequestBody(required=false) @Validated BffUpdateAppReqDto reqDTO){
        return OkrResult.success(baseService.updateApp(reqDTO));
    }

    /**
   * B1-2新增空间应用（平台）
   * gen by moon at 12/2/2022, 5:09:38 PM
   */
    @PostMapping("/oms/platform/base/addSpaceApp")
    @ApiOperation(value = "B1-2新增空间应用（平台）", response = OkrResult.class)
    public OkrResult<BffAddSpaceAppRespDto> addSpaceApp(@RequestBody(required=false) @Validated BffAddSpaceAppReqDto reqDTO){
        return OkrResult.success(baseService.addSpaceApp(reqDTO));
    }

    /**
   * B1-2查询联盟应用详情（平台）
   * gen by moon at 8/10/2022, 3:40:18 AM
   */
    @PostMapping("/oms/platform/base/queryAppDetail")
    @ApiOperation(value = "B1-2查询联盟应用详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryAppDetailRespDto> queryAppDetail(@RequestBody(required=false) @Validated BffQueryAppDetailReqDto reqDTO){
        return OkrResult.success(baseService.queryAppDetail(reqDTO));
    }

    /**
   * B1-2查询联盟应用列表（平台）
   * gen by moon at 8/10/2022, 3:40:16 AM
   */
    @PostMapping("/oms/platform/base/queryAppList")
    @ApiOperation(value = "B1-2查询联盟应用列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryAppListRespDto> queryAppList(@RequestBody(required=false) @Validated BffQueryAppListReqDto reqDTO){
        return OkrResult.success(baseService.queryAppList(reqDTO));
    }

    /**
   * B1-2修改空间（平台）
   * gen by moon at 8/10/2022, 3:39:59 AM
   */
    @PostMapping("/oms/platform/base/updateSpace")
    @ApiOperation(value = "B1-2修改空间（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateSpaceRespDto> updateSpace(@RequestBody(required=false) @Validated BffUpdateSpaceReqDto reqDTO){
        return OkrResult.success(baseService.updateSpace(reqDTO));
    }

    /**
   * B1-2查询空间详情（平台）
   * gen by moon at 8/10/2022, 3:39:57 AM
   */
    @PostMapping("/oms/platform/base/querySpaceDetail")
    @ApiOperation(value = "B1-2查询空间详情（平台）", response = OkrResult.class)
    public OkrResult<BffQuerySpaceDetailRespDto> querySpaceDetail(@RequestBody(required=false) @Validated BffQuerySpaceDetailReqDto reqDTO){
        return OkrResult.success(baseService.querySpaceDetail(reqDTO));
    }

    /**
   * B1-2新增空间（平台）
   * gen by moon at 11/28/2022, 2:19:26 PM
   */
    @PostMapping("/oms/platform/base/addSpace")
    @ApiOperation(value = "B1-2新增空间（平台）", response = OkrResult.class)
    public OkrResult<BffAddSpaceRespDto> addSpace(@RequestBody(required=false) @Validated BffAddSpaceReqDto reqDTO){
        return OkrResult.success(baseService.addSpace(reqDTO));
    }

    /**
   * B1-2查询场景详情（平台）
   * gen by moon at 8/10/2022, 3:39:26 AM
   */
    @PostMapping("/oms/platform/base/querySceneDetail")
    @ApiOperation(value = "B1-2查询场景详情（平台）", response = OkrResult.class)
    public OkrResult<BffQuerySceneDetailRespDto> querySceneDetail(@RequestBody(required=false) @Validated BffQuerySceneDetailReqDto reqDTO){
        return OkrResult.success(baseService.querySceneDetail(reqDTO));
    }

    /**
   * B1-2修改场景（平台）
   * gen by moon at 8/10/2022, 3:39:25 AM
   */
    @PostMapping("/oms/platform/base/updateScene")
    @ApiOperation(value = "B1-2修改场景（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateSceneRespDto> updateScene(@RequestBody(required=false) @Validated BffUpdateSceneReqDto reqDTO){
        return OkrResult.success(baseService.updateScene(reqDTO));
    }
/**
   * B1-2查询筛选空间列表(管理)(边界)
   * gen by moon at 10/25/2022, 10:01:15 AM
   */
    @PostMapping("/oms/platform/mgt/base/queryScreenSpaceListBorder")
    @ApiOperation(value = "B1-2查询筛选空间列表(管理)(边界)", response = OkrResult.class)
    public OkrResult<BffQueryScreenSpaceListBorderRespDto> queryScreenSpaceListBorder(@RequestBody(required=false) @Validated BffQueryScreenSpaceListBorderReqDto reqDTO){
        return OkrResult.success(baseService.queryScreenSpaceListBorder(reqDTO));
    }

}

